import { Controller, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { CollectService } from './collect.service';
import { CreateCollectDto } from './dto/create-collect.dto';
import { UpdateCollectDto } from './dto/update-collect.dto';

@Controller('collect')
export class CollectController {
  constructor(private readonly collectService: CollectService) {}

  @Post('add')
  create(@Body() createCollectDto: CreateCollectDto) {
    return this.collectService.update(createCollectDto);
  }

  // @Post('findAllbyuserid')
  // findAllbyuserid(@Body() userid) {
  //   return this.collectService.findAllbyuserid(userid);
  // }
  @Post('findAllbyarticleid')
  findAllbyarticleid(@Body() articleid) {
    return this.collectService.findAllbyarticleid(articleid);
  }
  
  @Post('findAllbyuserid')
  findAllArticlesByUserId(@Body() userid) {
    return this.collectService.findAllArticlesByUserId(userid.userid);
  }
  
  @Post('remove')
  remove(@Body() collectid) {
    return this.collectService.remove(collectid.collectid);
  }
}
